package com.spring.util;

import android.app.Activity;
import android.view.Window;
import android.view.WindowManager;

/**
 * Created by mac on 15/12/10.
 */
public class StatusBar {

    public StatusBar(boolean on, Activity activity) {
        Window win =activity.getWindow();
        WindowManager.LayoutParams winParams = win.getAttributes();
        final int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
        if (on) {
            winParams.flags |= bits;
        } else {
            winParams.flags &= ~bits;
        }
        win.setAttributes(winParams);
    }

}
